import com.alibaba.druid.pool.DruidDataSource;

public class Main {
    public static void main(String[] args) {

        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mysql://localhost:3306/test");
        dataSource.setUsername("root");
        dataSource.setPassword("root");
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        dataSource.setInitialSize(5);
        dataSource.setMaxActive(10);
        dataSource.setMinIdle(5);
        dataSource.setMaxWait(5000); // 5s

    }
}